import tensorflow as tf

X = tf.Variable([[7, 0, -9], [0.55, -113, 12]], dtype=tf.float32);

sign = tf.sign(X)

d_sign = tf.gradients(sign, X)

with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    
    print('------sign------')
    print(sess.run(sign))
    
    print('------d_sign------')
    print(sess.run(d_sign))